package com.yc.demo.exception;

import com.yc.demo.common.enums.ErrorCode;

/**
 * API错误异常
 *
 * @author admin
 */
public class ApiException extends RuntimeException {

    private static final long serialVersionUID = 8409304770555544827L;

    private int code = ErrorCode.ERROR.getCode();

    public ApiException() {

    }
    public ApiException(Exception ex) {
        super(ex);
    }

    public ApiException(String msg) {
        super(msg);
    }

    public ApiException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public ApiException(int code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }


}
